<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <button type="button" class="layui-btn layui-btn-sm btn-dark marginr5" onclick="export_word()">导出</button>
                <button type="button" class="layui-btn layui-btn-sm btn-dark marginr5" onclick="print_area()">打印</button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv" id="enginid_name" colspan="3"></td></tr>
                <tr><td class="tt">合同金额(元)</td><td id="shihemoney" class="tv"></td><td class="tt">合同税率(%)</td><td id="shirate" class="tv"></td></tr>
                <tr><td class="tt">应缴成本票比例(%)</td><td id="piaorate" class="tv"></td><td class="tt">成本票差额费比例(%)</td><td id="charate" class="tv"></td></tr>
                <tr><td class="tt">已开票金额含税(元)</td><td id="piao_kai_money" class="tv"></td><td class="tt">销项税(元)</td><td id="piao_kai_ratefee" class="tv"></td></tr>
                <tr><td class="tt">进项票金额含税(元)</td><td id="piao_shou_money" class="tv"></td><td class="tt">进项税(元)</td><td id="piao_shou_ratefee" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">本次拟开票</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">本次拟开票金额含税(元)</td><td class="tv" id="benkai" colspan="3"></td></tr>
                <tr><td class="tt">本次拟开票税率(%)</td><td id="benrate" class="tv"></td><td class="tt">本次拟开票税额(元)</td><td id="benratefee" class="tv"></td></tr>
                <tr><td class="tt">本次拟收成本票金额((元)</td><td id="benshou" class="tv"></td><td class="tt">本次拟收成本票税额(元)</td><td id="benshouratefee" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">截至本次票税情况</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">开票金额含税(元)</td><td id="zong_piao_kai_money" class="tv"></td><td class="tt">销项税额(元)</td><td id="zong_piao_kai_ratefee" class="tv"></td></tr>
                <tr><td class="tt">进项票金额含税((元)</td><td id="zong_piao_shou_money" class="tv"></td><td class="tt">进项税额(元)</td><td id="zong_piao_shou_ratefee" class="tv"></td></tr>
                <tr><td class="tt">增值税(元)</td><td class="tv" id="zengzhishui" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">计税规则</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>


        <div class="table-box tablenes">
            <div class="title">税费计算结果</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">应收取税费合计(元)</td><td id="yingshou_shuifee" class="tv"></td><td class="tt">已扣收税费合计(元)</td><td id="yikou_shuifee" class="tv"></td></tr>
                <tr><td class="tt">本次拟开票应计税费(元)</td><td class="tv" id="benni_yingshui" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

    </div>
</div>
<script>
    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;


        $("#enginid_name").text($("#enginid", parent.document).find('.choose_content').text());
        $("#shihemoney").text($("#shihemoney", parent.document).val());
        $("#shirate").text($("#shirate", parent.document).val());
        $("#piaorate").text($("#piaorate", parent.document).val());
        $("#charate").text($("#charate", parent.document).val());
        $("#piao_kai_money").text($("#piao_kai_money", parent.document).val());
        $("#piao_kai_ratefee").text($("#piao_kai_ratefee", parent.document).val());
        $("#piao_shou_money").text($("#piao_shou_money", parent.document).val());
        $("#piao_shou_ratefee").text($("#piao_shou_ratefee", parent.document).val());

        $("#benkai").text($("#benkai", parent.document).val());
        $("#benrate").text($("#benrate", parent.document).val());
        $("#benratefee").text($("#benratefee", parent.document).val());
        $("#benshou").text($("#benshou", parent.document).val());
        $("#benshouratefee").text($("#benshouratefee", parent.document).val());

        $("#zong_piao_kai_money").text($("#zong_piao_kai_money", parent.document).val());
        $("#zong_piao_kai_ratefee").text($("#zong_piao_kai_ratefee", parent.document).val());
        $("#zong_piao_shou_money").text($("#zong_piao_shou_money", parent.document).val());
        $("#zong_piao_shou_ratefee").text($("#zong_piao_shou_ratefee", parent.document).val());
        $("#zengzhishui").text($("#zengzhishui", parent.document).val());

        $("#yingshou_shuifee").text($("#yingshou_shuifee", parent.document).val());
        $("#yikou_shuifee").text($("#yikou_shuifee", parent.document).val());
        $("#benni_yingshui").text($("#benni_yingshui", parent.document).val());


        var listinfo = [];
        $('#list_list tr', parent.document).each(function (i) {
            if($(this).find('.name').length > 0){
                var name = $(this).find('.name').val();
                var explain = $(this).find('.explain').val();
                var yingshui = $(this).find('.yingshui').val();
                var yingshoushui = $(this).find('.yingshoushui').val();
                listinfo.push({
                    name:name,
                    explain:explain,
                    yingshui:yingshui,
                    yingshoushui:yingshoushui,
                });
            }else{
                var name = '合计';
                var explain = '';
                var yingshui = $(this).find('.heji_yingshui').val();
                var yingshoushui = $(this).find('.heji_yingshoushui').val();
                listinfo.push({
                    name:name,
                    explain:explain,
                    yingshui:yingshui,
                    yingshoushui:yingshoushui,
                });
            }
        });

        $('#list_list tr', parent.document).each(function (i) {

        });


        var mytableList = table.render({
            elem: "#datalist",data:listinfo, toolbar: '#toolbarDemo', page: false
            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
            , cols: [[
                {type:'numbers',title:'序号',fixed:'left'}
                ,{field: 'name', title: '税种'}
                ,{field: 'explain', title: '计算说明'}
                ,{field: 'yingshui', title: '应计税费金额(元)'}
                ,{field: 'yingshoushui', title: '应收取税费(元)'}
            ]]
            , done: function (res) {
                soulTable.render(this);
            }
        });


        render_from();

    });



</script>
</body>
</html>




